ifeq ($(targetbase),linux)
include $(MK_DIR)/sys.mk

OBJ_DIR=$(OBJ_BASE_DIR)
PHY_DIR=$(SDK_DIR)/phy_drv

# Make change here
LIB = ctcmars1s

ifeq ($(BOARD),ctc-sim)
CPPFLAGS += -DDRVIER_WORK_PLATFORM=1
else
CPPFLAGS += -DDRVIER_WORK_PLATFORM=0
endif

CPPFLAGS += -I$(SDK_DIR)/dal/include
CPPFLAGS += -I$(SDK_DIR)/dal/src/linux
CPPFLAGS += -I$(SDK_DIR)/sal/include
CPPFLAGS += -I$(SDK_DIR)/core/init
CPPFLAGS += -I$(SDK_DIR)/core/api/include
CPPFLAGS += -I$(SDK_DIR)/core/common/include
CPPFLAGS += -I$(SDK_DIR)/core/app
CPPFLAGS += -I$(SDK_DIR)/core
CPPFLAGS += -I$(SDK_DIR)/libpktxr/include

ifeq ($(PUMP),TRUE)
CPPFLAGS += -I$(SDK_DIR)/pump
CPPFLAGS += -I$(SDK_DIR)/pump/app
CPPFLAGS += -I$(SDK_DIR)/pump/lib
CPPFLAGS += -I$(SDK_DIR)/pump/nb_api
CPPFLAGS += -I$(SDK_DIR)/pump/sb_api
endif

ifeq ($(USW),yes)
CPPFLAGS += -I$(SDK_DIR)/core/usw/include
CPPFLAGS += -I$(SDK_DIR)/core/usw/include/ctc
CPPFLAGS += -I$(SDK_DIR)/core/usw/include/sys
CPPFLAGS += -I$(SDK_DIR)/ctccli/sdkcli/usw
CPPFLAGS += -I$(SDK_DIR)/driver/api
endif
CPPFLAGS += $(foreach n, $(COMPATIBAL_CHIP), -I$(SDK_DIR)/core/$(n)/include)
CPPFLAGS += $(foreach n, $(COMPATIBAL_CHIP), -I$(SDK_DIR)/core/$(n)/include/ctc)
CPPFLAGS += $(foreach n, $(COMPATIBAL_CHIP), -I$(SDK_DIR)/core/$(n)/include/sys)
CPPFLAGS += $(foreach n, $(COMPATIBAL_CHIP), -I$(SDK_DIR)/ctccli/sdkcli/$(n))

CPPFLAGS += -I$(SDK_DIR)/libctccli/include
CPPFLAGS += -I$(SDK_DIR)/libctccli/ctc_shell/include
CPPFLAGS += -I$(SDK_DIR)/libctccli/src

CPPFLAGS += -I$(SDK_DIR)/ctccli/sdkcli

CPPFLAGS += -I$(SDK_DIR)/driver

ifneq ($(CHIPNAME), $(filter $(CHIPNAME), greatbelt goldengate))
ifeq ($(BOARD),ctc-board)
CPPFLAGS += $(foreach n, $(CHIPNAME), -I$(SDK_DIR)/../cmodel/$(n)/mem_model/include)
endif
endif

CPPFLAGS += -I$(SDK_DIR)/app/config
CPPFLAGS += -I$(SDK_DIR)/app/sample
CPPFLAGS += -I$(SDK_DIR)/app/usr
CPPFLAGS += -I$(SDK_DIR)/app

CPPFLAGS += -I$(SDK_DIR)/dkits
ifeq ($(USW),yes)
CPPFLAGS += -I$(SDK_DIR)/dkits/usw
endif
CPPFLAGS += $(foreach n, $(CHIPNAME), -I$(SDK_DIR)/dkits/$(n))
CPPFLAGS += -I$(SDK_DIR)/dkits/common

# Make change here
SRCS += $(wildcard $(PHY_DIR)/driver/drvs/mars1s/*.c)

CPPFLAGS += -I$(PHY_DIR)/driver/core/inc
CPPFLAGS += -I$(SDK_DIR)/phy_drv/sdk_phy
CPPFLAGS += -DCTC_PHY_DRV_PLUGIN

# LD_LIBS += -L$(SDK_DIR)/$(LIB_DIR) -lctcsdk

include $(MK_DIR)/solib.mk
endif
